package org.example;



public class TaskRunner implements Runnable {
    @Override
    public void run() {
        try {
            for (int i = 10; i > 0; i--) {
                System.out.println("倒计时: " + i + " 秒");
                Thread.sleep(1000);
            }
            System.out.println("任务完成！");
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            System.out.println("任务被中断！");
        }
    }
}
